<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">

        <select multiple size="2" v-model="movie">
            <option v-for="item in movies" :key="item.value" :value="item.value">
                {{item.text}}</option>
        </select>
        <p>多选:{{movie}}</p>
        <div class="musice">
            <p>请选择你喜欢的音乐</p>
            <template v-for="item in musices" :key="item.value">
                <label :for="item.value">
                    <input :id="item.value" type="checkbox" :value="item.value" v-model="musice">
                    {{item.text}}
                </label>
            </template>
            <p>你喜欢的音乐是{{musice}}</p>
        </div>
    </div>
    <script src="https://unpkg.com/vue@next"></script>
    <script>
        //用vue创建app
        const app = Vue.createApp({
            // template: `

            // `,
            data() {
                return {
                    movies: [
                        { value: "movie1", text: "你的名字" },
                        { value: "movie2", text: "天气之子" },
                        { value: "movie3", text: "玲芽之旅" }
                    ],
                    movie: [],
                    musices: [
                        { value: "music1", text: "晴天" },
                        { value: "music2", text: "稻香" },
                        { value: "music3", text: "七里香" },
                    ],
                    musice: []
                }
            },
            methods: {

            }
        })
        //挂载app
        app.mount("#app")
    </script>

</body>

</html>